﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Xna.Framework;
using System.Linq;
using System.Text;

namespace Survival.Plants
{
    public class TallGrass : Plant
    {
        private Vector2 position;
        const int growthTimeInSeconds = 40;
        float aliveTimeInSeconds;  // TODO: Change this to parents alivetime when get performance sorted
        bool fullgrown;
        float scale;
        Stopwatch stopwatch = new Stopwatch();
        List<long> longlist = new List<long>();

        public override Vector2 Position { get { return position; } }
        public override float Scale { get { return 1; } }
        public override string SpriteName { get { return "TallGrass"; } }

        public TallGrass(Vector2 position, PlantServices plantServices)
            : base(plantServices)
        {
            this.position = position;
        }

        public override void Update(GameTime gameTime)
        {
            aliveTimeInSeconds += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (!fullgrown)
            {
                if (aliveTimeInSeconds > growthTimeInSeconds)
                    fullgrown = true;
                else
                    scale = aliveTimeInSeconds / growthTimeInSeconds;
            }
        }
    }
}
